package cn.rengy.web.framework.data.transcode;

import java.io.Serializable;
import java.sql.ResultSet;
import java.sql.SQLException;

import org.springframework.jdbc.core.RowMapper;

public class TranscodeColumn implements RowMapper<TranscodeColumn>,Serializable{
	/*//operation 运算
	public static final String OPERATION="operation";
	//add +, divide /,multiply *
	public static final String OPERATION_ADD="add";
	public static final String OPERATION_DIVIDE="divide";
	public static final String OPERATION_MULTIPLY="multiply";*/
	public TranscodeColumn(){
		
	}
	private String columnName;
	private String formatType;
	private String codeKey;
	private String fromPattern;
	private String toPattern;
	private String pattern;
	private String formula;
	private String sql_name;
	public String getFormatType() {
		return formatType;
	}
	public void setFormatType(String formatType) {
		this.formatType = formatType;
	}
	
	public String getFromPattern() {
		return fromPattern;
	}
	public void setFromPattern(String fromPattern) {
		this.fromPattern = fromPattern;
	}
	public String getToPattern() {
		return toPattern;
	}
	public void setToPattern(String toPattern) {
		this.toPattern = toPattern;
	}
	public String getPattern() {
		return pattern;
	}
	public void setPattern(String pattern) {
		this.pattern = pattern;
	}
	public String getColumnName() {
		return columnName;
	}
	public void setColumnName(String columnName) {
		this.columnName = columnName;
	}
	public String getCodeKey() {
		return codeKey;
	}
	public void setCodeKey(String codeKey) {
		this.codeKey = codeKey;
	}
	public String getFormula() {
		return formula;
	}
	public void setFormula(String formula) {
		this.formula = formula;
	}
	
	public String getSql_name() {
		return sql_name;
	}
	public void setSql_name(String sql_name) {
		this.sql_name = sql_name;
	}
	@Override
	public TranscodeColumn mapRow(ResultSet rs, int rowNum) throws SQLException {
		TranscodeColumn transcodeColumn = new TranscodeColumn();
		transcodeColumn.setCodeKey(rs.getString("code_key"));
		transcodeColumn.setColumnName(rs.getString("column_name"));
		transcodeColumn.setFormatType(rs.getString("format_type"));
		transcodeColumn.setFormula(rs.getString("formula"));
		transcodeColumn.setFromPattern(rs.getString("from_pattern"));
		transcodeColumn.setPattern(rs.getString("pattern"));
		transcodeColumn.setToPattern(rs.getString("to_pattern"));
        return transcodeColumn;
	}
	
}
